package aybolit.core.objects.model;

import javax.persistence.Entity;
import java.io.Serializable;
import java.sql.Timestamp;

/**
 * Created by IntelliJ IDEA.
 * User: Vadim
 * Date: 29.03.13
 * Time: 16:54
 * To change this template use File | Settings | File Templates.
 */
@javax.persistence.Table(name = "healing_analyzes", schema = "", catalog = "aybolit")
@Entity
public class HealingAnalyzes implements Serializable {
    private int healingAnalyzesId;

    @javax.persistence.Column(name = "healing_analyzes_id")
    @javax.persistence.Id
    public int getHealingAnalyzesId() {
        return healingAnalyzesId;
    }

    public void setHealingAnalyzesId(int healingAnalyzesId) {
        this.healingAnalyzesId = healingAnalyzesId;
    }

    private int healingId;

    @javax.persistence.Column(name = "healing_id")
    @javax.persistence.Basic
    public int getHealingId() {
        return healingId;
    }

    public void setHealingId(int healingId) {
        this.healingId = healingId;
    }

    private int analyzesNameId;

    @javax.persistence.Column(name = "analyzes_name_id")
    @javax.persistence.Basic
    public int getAnalyzesNameId() {
        return analyzesNameId;
    }

    public void setAnalyzesNameId(int analyzesNameId) {
        this.analyzesNameId = analyzesNameId;
    }

    private Timestamp timestamp;

    @javax.persistence.Column(name = "timestamp_")
    @javax.persistence.Basic
    public Timestamp getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(Timestamp timestamp) {
        this.timestamp = timestamp;
    }

    private String value;

    @javax.persistence.Column(name = "value")
    @javax.persistence.Basic
    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    private int status;

    @javax.persistence.Column(name = "status")
    @javax.persistence.Basic
    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        HealingAnalyzes that = (HealingAnalyzes) o;

        if (analyzesNameId != that.analyzesNameId) return false;
        if (healingAnalyzesId != that.healingAnalyzesId) return false;
        if (healingId != that.healingId) return false;
        if (status != that.status) return false;
        if (timestamp != null ? !timestamp.equals(that.timestamp) : that.timestamp != null) return false;
        if (value != null ? !value.equals(that.value) : that.value != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = healingAnalyzesId;
        result = 31 * result + healingId;
        result = 31 * result + analyzesNameId;
        result = 31 * result + (timestamp != null ? timestamp.hashCode() : 0);
        result = 31 * result + (value != null ? value.hashCode() : 0);
        result = 31 * result + status;
        return result;
    }

    private Healing healingByHealingId;

    @javax.persistence.ManyToOne
    public
    @javax.persistence.JoinColumn(name = "healing_id", referencedColumnName = "healing_id")
    Healing getHealingByHealingId() {
        return healingByHealingId;
    }

    public void setHealingByHealingId(Healing healingByHealingId) {
        this.healingByHealingId = healingByHealingId;
    }

    private AnalyzesName analyzesNameByAnalyzesNameId;

    @javax.persistence.ManyToOne
    public
    @javax.persistence.JoinColumn(name = "analyzes_name_id", referencedColumnName = "analyzes_name_id")
    AnalyzesName getAnalyzesNameByAnalyzesNameId() {
        return analyzesNameByAnalyzesNameId;
    }

    public void setAnalyzesNameByAnalyzesNameId(AnalyzesName analyzesNameByAnalyzesNameId) {
        this.analyzesNameByAnalyzesNameId = analyzesNameByAnalyzesNameId;
    }
}
